package exodus;

/**
 * Created with IntelliJ IDEA.
 * User: JSmith1
 * Date: 7/27/12
 * Time: 11:27 AM
 * A bean representing a weapon instance.
 */
public class Weapon implements Comparable<Weapon>{
    //fields
    private String serial; //a serial number denoting this weapon instance in the database
    private String name;
    private String ammo;
    private String loaded; //represents the serial number of a clip loaded in this weapon
    private int range;

    //constructors
    public Weapon(){}
    public Weapon(String serial, String name, String ammo, String loaded, int range){
        this.serial = serial;
        this.name = name;
        this.ammo = ammo;
        this.loaded = loaded;
        this.range = range;
    }

    //getters and setters

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAmmo() {
        return ammo;
    }

    public void setAmmo(String ammo) {
        this.ammo = ammo;
    }

    public String getLoaded() {
        return loaded;
    }

    public void setLoaded(String loaded) {
        this.loaded = loaded;
    }

    @Override
    public int compareTo(Weapon o) {
        return this.serial.compareTo(o.serial);
    }

    public boolean equals(Weapon o){
        return this.serial.equals(o.serial);
    }
}
